<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>糯米爸（付费流分享）爆款视频提取</title>
  <style>
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }
    
    body {
      width: 360px;
      height: 520px;
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      color: #333;
      overflow: hidden;
    }
    
    .container {
      padding: 16px;
      height: 100%;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
    }
    
    /* 头部区域 */
    .header {
      text-align: center;
      margin-bottom: 20px;
      color: white;
    }
    
    .header h1 {
      font-size: 18px;
      font-weight: 600;
      margin-bottom: 6px;
      text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .header h2 {
      font-size: 14px;
      font-weight: 400;
      opacity: 0.9;
      margin-bottom: 8px;
    }
    
    .contact-info {
      background: rgba(255,255,255,0.15);
      backdrop-filter: blur(10px);
      border-radius: 10px;
      padding: 6px 12px;
      font-size: 11px;
      border: 1px solid rgba(255,255,255,0.2);
    }
    
    /* 状态卡片 */
    .status-card {
      background: rgba(255,255,255,0.95);
      backdrop-filter: blur(10px);
      border-radius: 14px;
      padding: 16px;
      margin-bottom: 20px;
      box-shadow: 0 6px 24px rgba(0,0,0,0.1);
      border: 1px solid rgba(255,255,255,0.2);
    }
    
    .status {
      padding: 10px 14px;
      border-radius: 10px;
      text-align: center;
      font-weight: 500;
      margin-bottom: 16px;
      transition: all 0.3s ease;
      font-size: 13px;
    }
    
    .logged-in {
      background: linear-gradient(135deg, #4CAF50, #45a049);
      color: white;
      box-shadow: 0 3px 12px rgba(76, 175, 80, 0.3);
    }
    
    .logged-out {
      background: linear-gradient(135deg, #FF6B6B, #ee5a52);
      color: white;
      box-shadow: 0 3px 12px rgba(255, 107, 107, 0.3);
    }
    
    /* 按钮组 */
    .button-group {
      display: flex;
      flex-direction: column;
      gap: 10px;
      margin-bottom: 0;
    }
    
    .btn {
      padding: 12px 16px;
      border: none;
      border-radius: 10px;
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.3s ease;
      position: relative;
      overflow: hidden;
      text-align: center;
    }
    
    .btn:before {
      content: '';
      position: absolute;
      top: 0;
      left: -100%;
      width: 100%;
      height: 100%;
      background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
      transition: left 0.5s;
    }
    
    .btn:hover:before {
      left: 100%;
    }
    
    .btn-primary {
      background: linear-gradient(135deg, #007AFF, #0056CC);
      color: white;
      box-shadow: 0 4px 15px rgba(0, 122, 255, 0.3);
    }
    
    .btn-primary:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 20px rgba(0, 122, 255, 0.4);
    }
    
    .btn-success {
      background: linear-gradient(135deg, #34C759, #28A745);
      color: white;
      box-shadow: 0 4px 15px rgba(52, 199, 89, 0.3);
    }
    
    .btn-success:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 20px rgba(52, 199, 89, 0.4);
    }
    
    .btn-danger {
      background: linear-gradient(135deg, #FF3B30, #DC3545);
      color: white;
      box-shadow: 0 4px 15px rgba(255, 59, 48, 0.3);
    }
    
    .btn-danger:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 20px rgba(255, 59, 48, 0.4);
    }
    
    .btn-secondary {
      background: linear-gradient(135deg, #6C757D, #5A6268);
      color: white;
      box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
    }
    
    .btn-secondary:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
    }
    
    .btn:disabled {
      background: #E9ECEF;
      color: #6C757D;
      cursor: not-allowed;
      transform: none;
      box-shadow: none;
    }
    
    .btn:disabled:before {
      display: none;
    }
    
    /* 设置区域 */
    .settings {
      background: rgba(255,255,255,0.95);
      backdrop-filter: blur(10px);
      border-radius: 14px;
      padding: 16px;
      margin-bottom: 20px;
      box-shadow: 0 6px 24px rgba(0,0,0,0.1);
      border: 1px solid rgba(255,255,255,0.2);
    }
    
    .form-group {
      margin-bottom: 0;
    }
    
    .form-group:last-child {
      margin-bottom: 0;
    }
    
    label {
      display: block;
      margin-bottom: 6px;
      font-weight: 600;
      color: #495057;
      font-size: 13px;
    }
    
    input[type="number"] {
      width: 100%;
      padding: 10px 14px;
      border: 2px solid #E9ECEF;
      border-radius: 10px;
      font-size: 13px;
      transition: all 0.3s ease;
      background: white;
    }
    
    input[type="number"]:focus {
      outline: none;
      border-color: #007AFF;
      box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
    }
    
    /* 进度区域 */
    .progress {
      background: rgba(255,255,255,0.95);
      backdrop-filter: blur(10px);
      border-radius: 14px;
      padding: 16px;
      margin-bottom: 20px;
      box-shadow: 0 6px 24px rgba(0,0,0,0.1);
      border: 1px solid rgba(255,255,255,0.2);
      display: none;
    }
    
    .progress.show {
      display: block;
    }
    
    .progress p {
      margin-bottom: 6px;
      font-size: 13px;
      color: #495057;
    }
    
    .progress p:last-child {
      margin-bottom: 0;
    }
    
    .progress span {
      font-weight: 600;
      color: #007AFF;
    }
    
    /* 导出按钮区域 */
    .export-section {
      margin-bottom: 24px;
      text-align: center;
    }
    
    /* 底部联系信息 */
    .footer {
      text-align: center;
      padding: 16px;
      background: rgba(255,255,255,0.15);
      backdrop-filter: blur(10px);
      border-radius: 12px;
      border: 1px solid rgba(255,255,255,0.2);
      margin-top: auto;
    }
    
    .footer p {
      margin: 0;
      font-size: 11px;
      color: rgba(255,255,255,0.9);
    }
    
    .footer .wechat {
      font-weight: 600;
      color: white;
      font-size: 13px;
      margin-top: 3px;
    }
    
    /* 动画效果 */
    @keyframes fadeInUp {
      from {
        opacity: 0;
        transform: translateY(20px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }
    
    .container > * {
      animation: fadeInUp 0.6s ease forwards;
    }
    
    .container > *:nth-child(1) { animation-delay: 0.1s; }
    .container > *:nth-child(2) { animation-delay: 0.2s; }
    .container > *:nth-child(3) { animation-delay: 0.3s; }
    .container > *:nth-child(4) { animation-delay: 0.4s; }
    .container > *:nth-child(5) { animation-delay: 0.5s; }
  </style>
</head>
<body>
  <div class="container">
    <!-- 头部区域 -->
    <div class="header">
      <h1>糯米爸（付费流分享）</h1>
      <h2>爆款视频提取</h2>
      <div class="contact-info">
        投流学习联系微信nmbff188
      </div>
    </div>
    
    <!-- 状态卡片 -->
    <div class="status-card">
      <div id="loginStatus" class="status logged-out">
        未登录，请先登录抖音大人后台
      </div>
      
      <!-- 按钮组 -->
      <div class="button-group">
        <button id="startBtn" class="btn btn-primary" disabled>开始爬取</button>
        <button id="stopBtn" class="btn btn-secondary" disabled>停止爬取</button>
      </div>
    </div>
    
    <!-- 设置区域 -->
    <div class="settings">
      <div class="form-group">
        <label for="scrollDelay">滚动延迟 (毫秒)</label>
        <input type="number" id="scrollDelay" min="500" value="1500">
      </div>
    </div>
    
    <!-- 进度区域 -->
    <div id="progress" class="progress">
      <p>已爬取页数: <span id="currentPage">0</span> / <span id="totalPages">0</span></p>
      <p>已爬取视频数: <span id="videoCount">0</span></p>
    </div>
    
    <!-- 导出按钮 -->
    <div class="export-section" style="display: none;">
      <button id="exportBtn" class="btn btn-success" disabled>导出数据 (CSV)</button>
    </div>
    
    <!-- 底部联系信息 -->
    <div class="footer">
      <p><strong>投流学习联系微信</strong></p>
      <p class="wechat">nmbff188</p>
    </div>
  </div>
  
  <!-- 引入SheetJS库用于生成Excel文件 -->
  <script src="https://cdn.sheetjs.com/xlsx-0.19.3/package/dist/xlsx.full.min.js"></script>
  <script src="popup.js"></script>
</body>
</html> 